var http = require("http");
var url = require("url");

function start(router){
    http.createServer(function(req,res){
        console.log(req.url);
        console.log(url.parse(req.url).pathname);  //路由名称
        console.log(url.parse(req.url).query);  //路由参数名称
        router(url.parse(req.url).pathname);
        res.writeHead(200,{"Content-type":"text-plain"});
        res.write("HI");
        res.end();
    }).listen(8888);     
}

module.exports.start = start;

